<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div class="bigbox">
            <div class="tab-header">
                <!-- <div v-for="(item, index) in listData" class="tab-one" :class="{'tabActive': index == activeTag}" @click="activeTag = index">{{item}}</div> -->
                <div v-for="(item, index) in listData" class="tab-one" :class= "activeTag == index? 'tabActive': ''"  @click="activeTag = index">{{item}}</div>
            </div>
            <div class="tab-content" v-show="activeTag == 0">
                <div class="tab1-left">
                    1
                </div>
                <div class="tab1-right">
                    <div class="tab1-right_one" v-for="item in currentRifhrData">{{item}}</div>
                    <div class="tab1-right_showMore" @click="rightDataIsMore = !rightDataIsMore">点击更多</div>
                </div>
            </div>
            <div class="tab-content" v-show="activeTag != 0">
                qita
            </div>
        </div>
    </div>
</body>
</html>

<style>
    .bigbox {
        width: 1000px;
        height: 500px;
        padding: 10px;
        margin: 100px auto;
        border: 1px solid black;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }
    /* tab的顶部选择栏 */
    .tab-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    .tab-one {
        height: 40px;
        line-height: 40px;
        cursor: pointer;
        padding: 0 50px;
    }
    .tabActive {
        color: #fff;
        border-radius: 20px;
        background-color: rgb(112, 67, 235);
    }
    /* tab内容 */
    .tab-content {
        flex: 1;
        display: flex;
    }
    .tab1-left {
        width: 30%;
        margin-right: 10px;
        background-color: aqua;
    }
    .tab1-right {
        padding-left: 10px;
        flex: 1;
        background-color: rgb(106, 73, 167);
        height: 430px;
        overflow: auto;
    }
    .tab1-right_one {
        height: 100px;
        width: 500px;
        background-color: rgb(204, 92, 92);
        margin-top: 10px;
    }
    .tab1-right_showMore {
        margin-top: 20px;
        width: 100%;
        text-align: center;
    }
</style>

<script src="./vu2js.js"></script>
<!-- 引入样式 -->
<script>
    var app = new Vue({
        el: '#app',
        data: {
            listData: ['语文','数学','思想品德','科学实现','体育课'],
            activeTag: 0,
            rightData: [1,2,3,4,5,6],
            rightDataIsMore: false
        },
        created() {
        },
        computed: {
            currentRifhrData() {
                if (this.rightDataIsMore) {
                    return this.rightData
                } else {
                    return this.rightData.slice(0,3)
                }
            }
        },
        methods: {
            handleClick(tab, event) {
                console.log(tab, event);
            }
        }
    })
</script>